<!-- 搜索界面的用户list -->
<template>
  <div class="user">
    <ul>
      <li v-for="user in list"
          :key="user.id">
        <div class="left"><img v-lazy="user.avatarUrl"
               class="img-60"><span>{{ user.nickname }}</span>
          <span v-if="user.gender==2"
                class="gender1 gender">
            <svg class="icon cc"
                 aria-hidden="true">
              <use xlink:href="#icon-nv1"></use>
            </svg></span>
          <span v-if="user.gender==1"
                class="gender">
            <svg class="icon cc"
                 aria-hidden="true">
              <use xlink:href="#icon-nan"></use>
            </svg>
          </span>
        </div>
        <div class="right">{{ user.signature }}</div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      required: true,
      default: () => []
    }
  }
}
</script>

<style lang="less" scoped>
ul {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  li {
    padding-left: 30px;
    height: 80px;
    display: flex;
    width: 100%;
    justify-content: space-between;
    &:nth-child(even) {
      background-color: #fafafa;
    }
    &:hover {
      background-color: rgb(244, 243, 243);
      cursor: pointer;
    }
    .left {
      display: flex;
      align-items: center;
      .img-60 {
        width: 60px;
        height: 60px;
        border-radius: 30px;
      }
      span {
        margin-left: 20px;
        font-size: 14px;
      }
      .gender {
        width: 16px;
        height: 16px;
        border-radius: 8px;
        background-color: #b6eaf7;
      }
      .gender1 {
        background-color: #f6c3df;
      }
      .icon {
        margin-left: 1px;
        margin-top: 1px;
        width: 13px;
        height: 13px;
      }
    }
    .right {
      display: flex;
      align-items: center;
      margin-right: 50px;
      max-width: 208px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 13px;
      color: rgb(158, 156, 156);
    }
  }
}
</style>